<form
	action="<?=MozgRoute::Get('http')->Create(array('module' => 'admin', 'ctrl' => 'structure', 'action' => 'save_content_access'));?>"
	method="post" id="contentAccess" name="contentAccess">
<div class="cntAccess">
<table width="100%">
	<tr>
		<td width="1"><input type="checkbox" name="is_closed" value="1"
			<?=($this->elementObj->GetIsClosed() ? ' checked' : '');?>></td>
		<td>закрытый</td>
	</tr>
</table>
<table>
	<tr>
		<td class="r"><input type="submit" name="bsubmit" value="Сохранить"
			class="bt" /></td>
	</tr>
</table>
<input type="hidden" name="subcat" value="<?=$this->elementObj->GetId();?>">
<input type="hidden" name="cat" value="<?=$this->cid;?>"></div>
</form>
<script type="text/javascript">
$(document).ready(
  function()
  {
  	$('#contentAccess').submit(function () {

		var data = new Array();
		var i = 0;

		inputs = $('#contentAccess input');
		inputs.each(function () {
				obj = $(this);
    			if ((obj.attr('type') != 'checkbox') || (obj.attr('checked')))
    			{
					data[i++] = encodeURIComponent(obj.attr('name')) + '=' + encodeURIComponent(obj.val());
    			}
		});

		data = data.join('&');

		$.ajax( {url: this.action,
				dataType: 'json',
				type: this.method,
				data: data,
				success:function (data){
							if (data.status == 2)
							{
								showMessage(data.message, true);
								return true;
							}

							showMessage(data.message);
							return false;
						}
		} );

		return false;
  	});
  }
);
</script>